package org.mozhu.mboot.core.web.sitemesh.builder;

import org.mozhu.mboot.core.web.sitemesh.filter.SpringMVCSiteMeshFilter;
import org.sitemesh.builder.SiteMeshFilterBuilder;
import org.springframework.web.servlet.ViewResolver;

import javax.servlet.Filter;

public class SpringMVCSiteMeshFilterBuilder extends SiteMeshFilterBuilder {

    private ViewResolver viewResolver;

    public SpringMVCSiteMeshFilterBuilder(ViewResolver viewResolver) {
        this.viewResolver = viewResolver;
    }

    @Override
    public Filter create() {
        return new SpringMVCSiteMeshFilter(this.viewResolver,
                getSelector(),
                getContentProcessor(),
                getDecoratorSelector(),
                isIncludeErrorPages());
    }

}
